#ifndef REUTERSXMLPARSER_HPP
#define REUTERSXMLPARSER_HPP

#include <QtXml/qxml.h>

class ReutersDocument;

class ReutersXMLParser : public QXmlDefaultHandler {

    ReutersDocument* document_;

    bool d_;

    enum class NowReading {
        Date, Topics, Places, People, Orgs, Exchanges, Companies,
        Dateline, Body, never_mind_just_ignore_this_tag
    } tag_;

public:

    ReutersXMLParser (ReutersDocument*);

    bool startElement (const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts);

    bool characters (const QString& ch_in);

    bool endElement (const QString&, const QString& localName, const QString& qName);

    bool startDocument();

    bool endDocument();

};

#endif // REUTERSXMLPARSER_HPP
